﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EntityModel
{
    public class ApiContext:DbContext
    {
        public ApiContext(DbContextOptions<ApiContext>opts):base(opts) { 


        }
        public DbSet<EntityUser> EntityUsers { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<EntityUser>().HasData([
                    new EntityUser(){
                        Name="yizheng"
                    },
                    new EntityUser(){
                        Name="yangzhou"
                    }
                ]);
        }

    }
}
